<template>
	<div class="wrapper">
		
		<!-- header部分 -->
		<header>
			<p>用户注册</p>
		</header>
		
		<!-- 表单部分 -->
		<ul class="form-box">
			<li>
				<div class="title">
					手机号码：
				</div>
				<div class="content">
					<input type="text" placeholder="手机号码">
				</div>
			</li>
			<li>
				<div class="title">
					密码：
				</div>
				<div class="content">
					<input type="password" placeholder="密码">
				</div>
			</li>
			<li>
				<div class="title">
					确认密码：
				</div>
				<div class="content">
					<input type="password" placeholder="确认密码">
				</div>
			</li>
			<li>
				<div class="title">
					用户名称：
				</div>
				<div class="content">
					<input type="text" placeholder="用户名称">
				</div>
			</li>
			<li>
				<div class="title">
					性别：
				</div>
				<div class="content" style="font-size: 3vw;">
					<input type="radio" name="sex" checked style="width:6vw;height: 3.2vw;">男
					<input type="radio" name="sex" style="width:6vw;height: 3.2vw;">女
				</div>
			</li>
		</ul>
		
		<div class="button-login">
			<button onclick="location.href='login.html'">注册</button>
		</div>
		
		<!-- 底部菜单部分 -->
		<Footer></Footer>
		
	</div>
</template>

<script setup>
	import Footer from '../components/Footer.vue'
	import qs from 'qs';
	//导入路由相关的模块
	import {useRouter,useRoute} from 'vue-router';
	import {ref,inject,computed} from 'vue'
	import {getSessionStorage} from '../common.js'
	
	const axios = inject("axios");
	const router = useRouter();
	const route = useRoute();
	const user = getSessionStorage('user');
	const userId = route.query.userId;
	//未支付订单
	const ordersUnPaidArr = ref([]);
	//已支付订单
	const ordersPaidArr = ref([]);
	
	const init = () => {
		//根据订单编号查询订单信息
		axios.post('OrdersController/listOrdersByUserId', qs.stringify({
			userId:user.userId
		})).then((response) => {
			console.log(response.data);
			let result = response.data;
			for(let obj of result){
				
				//控制详单是否显示
				obj.isShowDetailet = false;
				//未支付订单
				if(obj.orderState == 0){
					ordersUnPaidArr.value.push(obj);
				}
				//已支付订单
				if(obj.orderState == 1){
					ordersPaidArr.value.push(obj);
				}
			}
		}).catch((error) => {
			console.log(error);
		});
	}
	//初始化商家信息
	init();
	
</script>

<style scoped>
	
	
</style>
